// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

// This code was generated by google-apis-code-generator 1.5.1

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   Wax API (wax/v1)
// Generated from:
//   Version: v1
//   Revision: 20130321
// Generated by:
//    Tool: google-apis-code-generator 1.5.1
//     C++: 0.1.3
#ifndef  GOOGLE_WAX_API_SUBSCRIPTION_H_
#define  GOOGLE_WAX_API_SUBSCRIPTION_H_

#include <string>
#include "googleapis/base/integral_types.h"
#include "googleapis/base/macros.h"
#include "googleapis/client/data/jsoncpp_data.h"
#include "googleapis/strings/stringpiece.h"

namespace Json {
class Value;
}  // namespace Json

namespace google_wax_api {
using namespace googleapis;

/**
 * No description provided.
 *
 * @ingroup DataObject
 */
class Subscription : public client::JsonCppData {
 public:
  /**
   * Creates a new default instance.
   *
   * @return Ownership is passed back to the caller.
   */
  static Subscription* New();

  /**
   * Standard constructor for an immutable data object instance.
   *
   * @param[in] storage  The underlying data storage for this instance.
   */
  explicit Subscription(const Json::Value& storage);

  /**
   * Standard constructor for a mutable data object instance.
   *
   * @param[in] storage  The underlying data storage for this instance.
   */
  explicit Subscription(Json::Value* storage);

  /**
   * Standard destructor.
   */
  virtual ~Subscription();

  /**
   * Returns a string denoting the type of this data object.
   *
   * @return <code>google_wax_api::Subscription</code>
   */
  const StringPiece GetTypeName() const {
    return StringPiece("google_wax_api::Subscription");
  }

  /**
   * Determine if the '<code>address</code>' attribute was set.
   *
   * @return true if the '<code>address</code>' attribute was set.
   */
  bool has_address() const {
    return Storage().isMember("address");
  }

  /**
   * Clears the '<code>address</code>' attribute.
   */
  void clear_address() {
    MutableStorage()->removeMember("address");
  }


  /**
   * Get the value of the '<code>address</code>' attribute.
   */
  const StringPiece get_address() const {
    const Json::Value& v = Storage("address");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>address</code>' attribute.
   *
   * The address of the receiving entity where notifications are delivered.
   * Specific to the channel mechanism.
   *
   * @param[in] value The new value.
   */
  void set_address(const StringPiece& value) {
    *MutableStorage("address") = value.data();
  }

  /**
   * Determine if the '<code>channel</code>' attribute was set.
   *
   * @return true if the '<code>channel</code>' attribute was set.
   */
  bool has_channel() const {
    return Storage().isMember("channel");
  }

  /**
   * Clears the '<code>channel</code>' attribute.
   */
  void clear_channel() {
    MutableStorage()->removeMember("channel");
  }


  /**
   * Get the value of the '<code>channel</code>' attribute.
   */
  const StringPiece get_channel() const {
    const Json::Value& v = Storage("channel");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>channel</code>' attribute.
   *
   * The delivery channel mechanism to use for notifications.
   *
   * @param[in] value The new value.
   */
  void set_channel(const StringPiece& value) {
    *MutableStorage("channel") = value.data();
  }

  /**
   * Determine if the '<code>channelParams</code>' attribute was set.
   *
   * @return true if the '<code>channelParams</code>' attribute was set.
   */
  bool has_channel_params() const {
    return Storage().isMember("channelParams");
  }

  /**
   * Clears the '<code>channelParams</code>' attribute.
   */
  void clear_channel_params() {
    MutableStorage()->removeMember("channelParams");
  }


  /**
   * Get a reference to the value of the '<code>channelParams</code>' attribute.
   */
  const client::JsonCppAssociativeArray<string > get_channel_params() const {
     const Json::Value& storage = Storage("channelParams");
    return client::JsonValueToCppValueHelper<client::JsonCppAssociativeArray<string > >(storage);
  }

  /**
   * Gets a reference to a mutable value of the '<code>channelParams</code>'
   * property.
   *
   * Additional parameters controlling delivery channel behavior.
   *
   * @return The result can be modified to change the attribute value.
   */
  client::JsonCppAssociativeArray<string > mutable_channelParams() {
    Json::Value* storage = MutableStorage("channelParams");
    return client::JsonValueToMutableCppValueHelper<client::JsonCppAssociativeArray<string > >(storage);
  }

  /**
   * Determine if the '<code>clientToken</code>' attribute was set.
   *
   * @return true if the '<code>clientToken</code>' attribute was set.
   */
  bool has_client_token() const {
    return Storage().isMember("clientToken");
  }

  /**
   * Clears the '<code>clientToken</code>' attribute.
   */
  void clear_client_token() {
    MutableStorage()->removeMember("clientToken");
  }


  /**
   * Get the value of the '<code>clientToken</code>' attribute.
   */
  const StringPiece get_client_token() const {
    const Json::Value& v = Storage("clientToken");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>clientToken</code>' attribute.
   *
   * An arbitrary string associated with the subscription that is delivered to
   * the target address with each notification for this subscription.
   *
   * @param[in] value The new value.
   */
  void set_client_token(const StringPiece& value) {
    *MutableStorage("clientToken") = value.data();
  }

  /**
   * Determine if the '<code>expiration</code>' attribute was set.
   *
   * @return true if the '<code>expiration</code>' attribute was set.
   */
  bool has_expiration() const {
    return Storage().isMember("expiration");
  }

  /**
   * Clears the '<code>expiration</code>' attribute.
   */
  void clear_expiration() {
    MutableStorage()->removeMember("expiration");
  }


  /**
   * Get the value of the '<code>expiration</code>' attribute.
   */
  int64 get_expiration() const {
    const Json::Value& storage = Storage("expiration");
    return client::JsonValueToCppValueHelper<int64 >(storage);
  }

  /**
   * Change the '<code>expiration</code>' attribute.
   *
   * The expiration instant for this subscription if it is defined.
   *
   * @param[in] value The new value.
   */
  void set_expiration(int64 value) {
    client::SetJsonValueFromCppValueHelper<int64 >(
      value, MutableStorage("expiration"));
  }

  /**
   * Determine if the '<code>id</code>' attribute was set.
   *
   * @return true if the '<code>id</code>' attribute was set.
   */
  bool has_id() const {
    return Storage().isMember("id");
  }

  /**
   * Clears the '<code>id</code>' attribute.
   */
  void clear_id() {
    MutableStorage()->removeMember("id");
  }


  /**
   * Get the value of the '<code>id</code>' attribute.
   */
  const StringPiece get_id() const {
    const Json::Value& v = Storage("id");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>id</code>' attribute.
   *
   * A UUID for the subscription.
   *
   * @param[in] value The new value.
   */
  void set_id(const StringPiece& value) {
    *MutableStorage("id") = value.data();
  }

  /**
   * Determine if the '<code>kind</code>' attribute was set.
   *
   * @return true if the '<code>kind</code>' attribute was set.
   */
  bool has_kind() const {
    return Storage().isMember("kind");
  }

  /**
   * Clears the '<code>kind</code>' attribute.
   */
  void clear_kind() {
    MutableStorage()->removeMember("kind");
  }


  /**
   * Get the value of the '<code>kind</code>' attribute.
   */
  const StringPiece get_kind() const {
    const Json::Value& v = Storage("kind");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>kind</code>' attribute.
   *
   * A subscription to an API resource.
   *
   * @param[in] value The new value.
   */
  void set_kind(const StringPiece& value) {
    *MutableStorage("kind") = value.data();
  }

  /**
   * Determine if the '<code>topicId</code>' attribute was set.
   *
   * @return true if the '<code>topicId</code>' attribute was set.
   */
  bool has_topic_id() const {
    return Storage().isMember("topicId");
  }

  /**
   * Clears the '<code>topicId</code>' attribute.
   */
  void clear_topic_id() {
    MutableStorage()->removeMember("topicId");
  }


  /**
   * Get the value of the '<code>topicId</code>' attribute.
   */
  const StringPiece get_topic_id() const {
    const Json::Value& v = Storage("topicId");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>topicId</code>' attribute.
   *
   * An opaque topic id that identifies the backend resource which has been
   * subscribed to. Stable across different API versions.
   *
   * @param[in] value The new value.
   */
  void set_topic_id(const StringPiece& value) {
    *MutableStorage("topicId") = value.data();
  }

  /**
   * Determine if the '<code>topicUri</code>' attribute was set.
   *
   * @return true if the '<code>topicUri</code>' attribute was set.
   */
  bool has_topic_uri() const {
    return Storage().isMember("topicUri");
  }

  /**
   * Clears the '<code>topicUri</code>' attribute.
   */
  void clear_topic_uri() {
    MutableStorage()->removeMember("topicUri");
  }


  /**
   * Get the value of the '<code>topicUri</code>' attribute.
   */
  const StringPiece get_topic_uri() const {
    const Json::Value& v = Storage("topicUri");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>topicUri</code>' attribute.
   *
   * The canonicalized URI of the subscribed-to resource.
   *
   * @param[in] value The new value.
   */
  void set_topic_uri(const StringPiece& value) {
    *MutableStorage("topicUri") = value.data();
  }

 private:
  void operator=(const Subscription&);
};  // Subscription
}  // namespace google_wax_api
#endif  // GOOGLE_WAX_API_SUBSCRIPTION_H_
